home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / intrfc62.zip / NAMETYPE.PAS < prev    next >
Pascal/Delphi Source File  |  1991-06-14  |  3KB  |  111 lines

  1. unit nametype;
  2.  
  3. { Unit of type/const definitions for namelist unit }
  4.  
  5. interface
  6. type
  7.   type_def_ptr = ^type_def_rec;
  8.   type_def_rec = record
  9.     type_type : byte;
  10.     other_byte : byte;
  11.     size : word;
  12.     base_type : word;
  13.     case integer of
  14.     1 : ( element_ofs,element_unit,index_ofs,index_unit: word );
  15.     2 : ( hash_ofs, first_ofs :word;
  16.   {3}     parent_ofs, parent_unit, vmt_size :word;
  17.   {3}     handle,w10,self_type_ofs : word );
  18.     7 : ( base_ofs,base_unit:word );
  19.     6 : ( return_ofs,return_unit,num_args:word );
  20.     8 : ( target_ofs,target_unit:word );
  21.    15 : ( lower,upper : longint;
  22.           type_ofs,type_unit:word
  23.         );
  24.    -1 : ( who_knows : array[3..8] of word
  25.         );
  26.   end;
  27.  
  28.   type_info_ptr = ^type_info_rec;
  29.   type_info_rec = record
  30.     type_def_ofs,type_unit : word;
  31.   end;
  32.  
  33.   var_flags = set of (const_flag,      { initialized data }
  34.                       local,           { on the stack     }
  35.                       referenced,      { var parameter    }
  36.                       field,           { field of a record or object }
  37.                       absolute,        { declared absolute something else }
  38.                       argument,        { an argument to the func/proc }
  39.                       v64,v128);
  40.  
  41.   var_info_ptr = ^var_info_rec;
  42.   var_info_rec = record
  43.     flags : var_flags;
  44.     offset,  { within the appropriate section }
  45.     in_unit, { either unit number if absolute, or data block number }
  46.     type_def_ofs,type_unit : word;
  47.   end;
  48.  
  49.   const_info_ptr = ^const_info_rec;
  50.   const_info_rec = record
  51.     type_def_ofs,type_unit : word;
  52.     case integer of
  53.     0:  (intval:longint);
  54.     1:  (realval:real);    { never used? }
  55.     2:  (stringval:string);
  56.     3:  (extendval:extended);
  57.     4:  (boolval:boolean);
  58.     5:  (charval:char);
  59.     end;
  60.  
  61.   arg_ptr = ^arg_rec;
  62.   arg_rec = record
  63.     type_def_ofs,type_unit : word;
  64.     flags : var_flags;
  65.   end;
  66.  
  67.   func_type_ptr = ^func_type_rec;
  68.   func_type_rec = record
  69.     type_def_ofs,type_unit,num_args : word;
  70.   end;
  71.  
  72.   code_flags = set of (far_entry,inline_code,f4,external_code,method,construct,
  73.                        destruct,assembler);
  74.   obj_flags  = set of (exported,windows_frame,from_dll,by_name,
  75.                        dynamic,local_code,f40,f80);
  76.  
  77.   func_info_ptr = ^func_info_rec;
  78.   func_info_rec = record
  79.     code_type:code_flags;
  80.     obj_type :obj_flags;
  81.     entry_ofs,parent_ofs,local_hash,vmt_entry,next_method,w6,w7:word;
  82.     func_type : func_type_rec;
  83.   end;
  84.  
  85.   system_info_ptr = ^system_info_rec;
  86.   system_info_rec = record
  87.     addr_ofs, flags : byte;
  88.   end;
  89.  
  90. const
  91.   record_id   =  2;
  92.   object_id   =  3;
  93.   objpriv_id  =  4;
  94.   const_id    = 80;
  95.   type_id     = 81;
  96.   var_id      = 82;
  97.   proc_id     = 83;
  98.   sys_proc_id = 84;
  99.   sys_fn_id   = 85;
  100.   sys_new_id  = 86;
  101.   sys_port_id = 87;
  102.   sys_mem_id  = 88;
  103.   unit_id     = 89;
  104.   init_id     = 128;   { Just hope that these haven't already been taken! }
  105.   uses_id     = 129;
  106.   local_id    = 130;
  107.   referenced_id = 131;
  108.  
  109. implementation
  110. end.
  111.